package edu.stthomas.seis770.visitor;

/**
 * Exercise part3 driver
 */
public class ReflectiveHTMLVisitorDriver {

    public static void main(String[] args) {

        if (0 == args.length) {
            System.err.println("Syntax: edu.stthomas.seis770.visitor.ReflectiveHTMLVisitorDriver <xmldocument>");
            return;
        }

        try {
            String xmlFileName = args[0];
            XMLDomTraverser xmlTraverser = new XMLDomTraverser(xmlFileName);
            ReflectiveHTMLVisitor htmlVisitor = new ReflectiveHTMLVisitor();
            xmlTraverser.traverse(htmlVisitor);
            htmlVisitor.flush();

        } catch (Exception exception) {
            System.err.println("Exception...");
            exception.printStackTrace();
        }
    }
}